#while的使用，当满足条件，执行语句
i =1
sum =0
while i<=100:
    sum += i
    i += 1
print(sum)

#break的使用：结束当前循环
i2 = 1
sum2 = 0
while i2<=100:
    if i2>10: #当i2=11时，条件满足，break
        break #结束当前循环
    i2 += 1
    sum2 += i2
print('sum2 = ',sum2)


#continue的使用:跳过本次循环，进行下一次循环
n = 0
while n<10:
    n += 1
    if n % 2 ==0:
        continue
    print(n)